﻿using System;
using System.Collections.Generic;

namespace Delphi.Mimir.Data.Entities.Final.Helpers {
    public class ExchangeLastLoad {
        public ExchangeLastLoad() {
            LastControls = new List<LastLoadControls>();
        }

        public string ExchangeCode { set; get; }
        public bool? HasIntraDayProduct { set; get; }
        public string LoadTypeCode { set; get; }
        public TimeZone Timezone { set; get; }
        public TimeSpan LocalClosingHour { set; get; }
        public TimeSpan ClosingHourUtc { get {
                return TimeZoneInfo.ConvertTimeToUtc(new DateTime() + LocalClosingHour, TimeZoneInfo.FindSystemTimeZoneById(Timezone.Name)).TimeOfDay; 
            } }
        public IEnumerable<LastLoadControls> LastControls { set; get; }

        public class LastLoadControls {
            public LastLoadControls() {
                LastLoad = new Load();
            }
            public int LoadControlId { set; get; }
            public string LoadTypeCode { set; get; }
            public Load LastLoad { set; get; }
            public TimeSpan loadOffset { set; get; }

        }
    }
}
